'\" t
.\"     Title: ccntestloop
.\"    Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
.\"      Date: 01/10/2014
.\"    Manual: \ \&
.\"    Source: \ \& 0.8.2
.\"  Language: English
.\"
.TH "CCNTESTLOOP" "1" "01/10/2014" "\ \& 0\&.8\&.2" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
ccntestloop \- runs the CCNx unit tests repeatedly
.SH "SYNOPSIS"
.sp
\fBccntestloop\fR [ start | stop | restart | status ]
.sp
\fBccntestloop\fR [\-h]
.SH "DESCRIPTION"
.sp
This shell script is intended to be run from the top\-level of the CCNx distribution\&. Results of the test runs are kept in the testdir subdirectory, which is created if necessary\&. However, testdir may be a symlink to another directory (preferably on the same file system)\&. It is advisable to link to some location outside of the workspace to avoid loss of test results due to a git clean command\&.
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fBccntestloop start\fR
starts the test run in the background\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fBccntestloop stop\fR
stops a test run in the background\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fBccntestloop restart\fR
stops a test run in the background, and then starts a new one in the background\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fBccntestloop status\fR
prints current test status\&.
.RE
.sp
If no options are specified, executes the test run in the foreground\&.
.sp
The testdir/config file is sourced as a sh script upon startup\&. This allows the environment variables to be set up for the next round\&. Creative use of this capability allows for such things as testing various combinations of parameters on each run\&. Look in testdir/config\&.defaults for examples\&.
.sp
There is provision for customization by means of executable hooks called at various stages:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
If
testdir/hooks/update
is present and executable, it is executed to update sources before each run\&. If it returns non\-zero status, the testing will be stopped\&. The default behavior is to pull from a configurable git branch unless modified files are present\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
If
testdir/hooks/success
is present and executable, it is executed after every successful run\&. It should return a status of 0 to continue on to the next run, or nonzero to stop\&. The default is to continue\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
If
testdir/hooks/failure
is present and executable, it is executed after every unsuccessful run\&. The status is checked in the same way, but the default is to stop\&.
.RE
.sp
The run number is passed as an argument to these hooks\&.
.sp
One recommended strategy is to set up testdir/hooks/failure to notify you of the failure and then stop, then set up a cron job to start the test loop several times per day (and do nothing if it is running)\&. That way you end up with a bounded number of failures to look at each day, but when all is well you test continuously\&.
.SH "OPTIONS"
.PP
\fB\-h\fR
.RS 4
Outputs usage information
.RE
.SH "EXIT STATUS"
.PP
\fB0\fR
.RS 4
Success
.RE
.PP
\fB1\fR
.RS 4
Failure
.RE
.SH "AUTHOR"
.sp
Michael Plass
